Skip to content

Conversation

@ShahanaFarooqui
Copy link
Collaborator

clnrest's utoipa-swagger-ui library has an indirect rust-embed dependency which by default includes timestamps in build. It results in non-deterministic build for clnrest. Using environment variable SOURCE_DATE_EPOCH with fixed value will enforce a consistent timestamp for builds.

Also adding the --locked flag to ensure the release build uses exact dependencies from Cargo.lock. The --locked flag is particularly important for deterministic builds as it prevents Cargo from updating the lockfile.

Fixes #8288.

Changelog-Fixed: Core lightning builds for Ubuntu Focal, Jammy and Noble are deterministic again.

…uilds

clnrest's `utoipa-swagger-ui` library has an indirect `rust-embed` dependency which by default includes timestamps in build. It results in non-deterministic build for clnrest. Using environment variable `SOURCE_DATE_EPOCH` with fixed value will enforce a consistent timestamp for builds.

Also adding the `--locked` flag to ensure the release build uses exact dependencies from Cargo.lock. The `--locked` flag is particularly important for deterministic builds as it prevents Cargo from updating the lockfile.

Fixes ElementsProject#8288.

Changelog-Fixed: Core lightning builds for Ubuntu Focal, Jammy and Noble are deterministic again.
@ShahanaFarooqui ShahanaFarooqui mentioned this pull request Sep 12, 2025
@ShahanaFarooqui ShahanaFarooqui requested review from daywalker90 and rustyrussell and removed request for cdecker September 12, 2025 19:42
@ShahanaFarooqui ShahanaFarooqui modified the milestones: 25.09.1, v25.12 Sep 12, 2025
@daywalker90
Copy link
Collaborator

Wow great find, back when i tried to fix it my LLM didn't point me to this and now it does... Also the maintainer didn't point me to this either when i implemented my fix with the feature flag.

I've built clnrest 3 times in release mode with that ENV set and i got the same hash every time so i'm pretty sure it works!

@rustyrussell rustyrussell merged commit 490fb0f into ElementsProject:master Sep 15, 2025
72 of 76 checks passed
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮 Great find!

@ShahanaFarooqui ShahanaFarooqui added the 25.09.2 Candidates if we do a 25.09.2 label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

25.09.2 Candidates if we do a 25.09.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reproducible build is not deterministic

3 participants